TESTS=Tsubstitute.cpp Tpower.cpp Tdifferentiation.cpp
DALL=$(TESTS:.cpp=.d)
SALL=$(TESTS:.cpp=.s)
CXX=g++
CXXFLAGS=-Wall -pedantic $(FLIB)
NEWLIB=../../newlib/

all.d: $(DALL)
	@echo " "

all.s: $(SALL)
	@echo " "
	
test:
	./Tsubstitute.test
	./Tpower.test
	./Tdifferentiation.test

clean:
	rm -f *.out *.core *.o *test


Tsubstitute.d: 
	make FLIB="-fPIC" Tsubstitute
Tsubstitute.s:
	make Tsubstitute FLIB="-static"
Tsubstitute: tests.h Tsubstitute.cpp
	$(CXX) $(CXXFLAGS) -o $@.test -I $(NEWLIB) -L $(NEWLIB) Tsubstitute.cpp -lsympycpp -lgmpxx -lgmp


Tpower.d: 
	make FLIB="-fPIC" Tpower
Tpower.s:
	make FLIB="-static" Tpower
Tpower: tests.h Tpower.cpp
	$(CXX) $(CXXFLAGS) -o $@.test -I $(NEWLIB) -L $(NEWLIB) Tpower.cpp -lsympycpp -lgmpxx -lgmp


Tdifferentiation.d: 
	make FLIB="-fPIC" Tdifferentiation
Tdifferentiation.s:
	make FLIB="-static" Tdifferentiation
Tdifferentiation: tests.h Tdifferentiation.cpp
	$(CXX) $(CXXFLAGS) -o $@.test -I $(NEWLIB) -L $(NEWLIB) Tdifferentiation.cpp -lsympycpp -lgmpxx -lgmp

